<?php
namespace Admin\Controlelr;
use Think\Controller;
class LayoutController extends Controller{
    function layout(){
        session_start();
        if(isset($_SESSION['username'])){
            // session_unset();//free all session variable
            session_destroy();//销毁一个会话中的全部数据
            echo "<script>alert('退出成功');parent.location.href='index';</script>";
        }else{
            echo "<script>alert('退出失败');parent.location.href='index';</script>";
        }
    }
}